package org.dxj.restaurantmanagementsystem.controller;

import org.dxj.restaurantmanagementsystem.entity.User;
import org.dxj.restaurantmanagementsystem.service.IUserService;
import org.dxj.restaurantmanagementsystem.service.impl.UserServiceImpl;

import java.io.IOException;
import java.util.List;

/**
 * @author Ding
 * @date 2019/11/23 17:53
 */
public class UserController {

    /**
     * 创建UserService对象
     */
    IUserService iUserService=new UserServiceImpl();

    /**
     * 增加用户信息Controller
     * @param user
     * @return boolean
     * @throws IOException
     */
   public boolean insertUserController(User user) throws IOException {
   if (user==null){
       return false;
   }else {
       iUserService.insertUserService(user);
       return true;
   }
    }

    /**
     * 根据用户id删除用户信息Controller
     * @param id
     * @return boolean
     */
    public boolean deleteUserController(Integer id){
       return false;
    }

    /**
     * 根据用户id更改用户信息Controller
     * @param user
     * @param id
     * @return boolean
     */
    public boolean updateUserController(User user,Integer id){
        return false;
    }

    /**
     * 根据id查询用户信息Controller
     * @param id
     * @return List<User>
     */
    public List<User> selectUserController(Integer id){
        return null;
    }
}
